package com.api.shopapi.service;


import com.alibaba.fastjson.JSONArray;
import com.api.shopapi.entity.Elderly;
import com.api.shopapi.entity.dto.ElderlyDTO;
import com.api.shopapi.entity.dto.ElderlyDTO1;
import com.api.shopapi.entity.dto.ElderlyDTO2;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

public interface ElderlyService {

    int insert(Elderly elderly);

    int delete(String elderlyCode);

    int update(Elderly elderly);

    ElderlyDTO  getByElderlyCode(String elderlyCode);

    ElderlyDTO getByUserCode(String userCode);

    PageInfo<ElderlyDTO> getListByGovernmentCode(int pageIndex,
                                                 int pageSize,
                                                 String governmentCode,
                                                 String name,
                                                 String phone,int status);

    ElderlyDTO getByPhone(String phone);

    ElderlyDTO getByIdCard(String idCard);



    PageInfo<ElderlyDTO> getSelectForGov(int pageIndex, int pageSize, Date startTime, Date endTime, String zoneCode, String governmentCode, String phone, String idCard, String name, int censusRegister);

    List<ElderlyDTO> getFiltrateBatchRechargeElderly(String zoneCode,
                                                     String phone,
                                                     String governmentCode,
                                                     String name,
                                                     int censusRegister,
                                                     int elderlyClass);

    PageInfo<ElderlyDTO> getRechargeElderly(int pageIndex,
                                            int pageSize,
                                            String zoneCode,
                                            String phone,
                                            String governmentCode,
                                            String name,
                                            int censusRegister,
                                            int elderlyClass);

    PageInfo<ElderlyDTO> getCarePage(int pageIndex,
                                    int pageSize,
                                    String governmentCode,
                                    String name,
                                    int month,
                                    int day);

    Double getMonetary(String elderlyCode,
                       Date startTime,
                       Date endTime);

    PageInfo<ElderlyDTO> getForConsumerUsers(int pageIndex,int pageSize,String governmentCode,String businessCode,
                                             String startTime,String endTime,int orderType,String name);


    int getElderlyClassCount(int elderlyClassValue,String governmentCode);

    int getElderlyClassCountTotal(int elderlyClassValue, String governmentCode);

    int getElderlyClassCountByNew(int elderlyClassValue,String governmentCode);

    Elderly getByIcCard(String icCard);

    Elderly getByIcCardAllStatus(String icCard);

    PageInfo<ElderlyDTO> getElderlyDTOByAppNew(int pageIndex, int pageSize, String zoneCode, String governmentCode, String name, String phone);

    ElderlyDTO2 getElderlyList(String userCode);


    PageInfo<ElderlyDTO> getNewElderly(int pageIndex, int pageSize, String name, String idCard, String phone, int elderlyClass, String zoneCode, String governmentCode,Date startTime,Date endTime);

    List<ElderlyDTO> getByElderly(String name, String idCard, String phone, int elderlyClass, String zoneCode,
                                  String governmentCode, Date startTime, Date endTime);




    /**
     * 查询政府下的老人
     * */
    List<Elderly> ListElderlyByGovernmentCode(String governmentCode);


    /**
     * 查询政府下到男性老人
     * */
    List<Elderly> ListElderlyByGovernmentCodeMan(String governmentCode);


    String getByElderlyNameToElderlyCode(String elderlyCode);


    PageInfo<ElderlyDTO> pageByInsCode(int pageIndex, int pageSize, String institutionCode, String name,
                                               String phone,int status, String zoneCode);
    List<Elderly> listByInsCode(String institutionCode);
    PageInfo<Elderly> pageByInsCodeCheckinStatus(int pageIndex, int pageSize,String institutionCode, String name,
                                                 String phone, int checkinStatus);



    PageInfo<ElderlyDTO> pageByGovCode(int pageIndex, int pageSize, String governmentCode, String name,
                                       String phone,int status, String zoneCode);

    PageInfo<Elderly> pageByGovCodeInsCodeName(int pageIndex, int pageSize,
                                                  String governmentCode,
                                                  String institutionCode, String name);



    PageInfo<Elderly> pageByGovCodeCheckinStatus(int pageIndex, int pageSize,String governmentCode,
                                                 String name,
                                                 String phone, int checkinStatus);



    PageInfo<Elderly> pageByInsCodeApplyStatus(int pageIndex, int pageSize,
                                               String institutionCode, String name,
                                               String phone, int applyStatus);


    PageInfo<Elderly> pageByGovCodeApplyStatus(int pageIndex, int pageSize,
                                               String governmentCode, String name,
                                               String phone, int applyStatus);


}
